import Vue from 'vue'
import Router from 'vue-router'
const login = r => require.ensure([], () => r(require('@/page/Login')), 'login');
const user = r => require.ensure([], () => r(require('@/page/User')), 'user');
const manage = r => require.ensure([], () => r(require('@/page/Manage')), 'manage');
const idc = r => require.ensure([], () => r(require('@/page/Idc')), 'idc');
const equipment = r => require.ensure([], () => r(require('@/page/Equipment')), 'equipment');
const cabinet = r => require.ensure([], () => r(require('@/page/Cabinet')), 'cabinet');
const refund = r => require.ensure([], () => r(require('@/page/Refund')), 'refund');
const service = r => require.ensure([], () => r(require('@/page/Service')), 'service');
const service_url = r => require.ensure([], () => r(require('@/page/ServiceUrl')), 'service_url');
const tablecommon = r => require.ensure([], () => r(require('@/components/tableCommon')), 'tablecommon');
const dashboard = r => require.ensure([], () => r(require('@/page/Dashboard')), 'dashboard');
const contract = r => require.ensure([], () => r(require('@/page/Contract')), 'contract');
const wiki = r => require.ensure([], () => r(require('@/page/Wiki')), 'wiki');
const wikiview = r => require.ensure([], () => r(require('@/components/wikiView')), 'wikiview');
const wayneservice = r => require.ensure([], () => r(require('@/page/WayneService')), 'wayneservice');
Vue.use(Router)

export default new Router({
	mode: 'history',
	routes: [{
			path: '/login',
			name: 'Login',
			component: login
		},
		{
			path: '/',
			redirect: {
				name: 'Dashboard'
			},
		},
		{
			path: '/wiki/view/:id',
			component: wikiview,
			name: 'Wikiview'
		},
		{
			path: '/manage',
			name: 'Manage',
			component: manage,
			children: [{
					path: '/idc',
					component: idc,
					name: 'Idc'
				},
				{
					path: '/equipment',
					component: equipment,
					name: 'Equipment'
				},
				{
					path: '/cabinet',
					component: cabinet,
					name: 'Cabinet'
				},
				{
					path: '/refund',
					component: refund,
					name: 'Refund'
				},
				{
					path: '/common',
					component: tablecommon,
					name: 'Tablecommon'
				},
				{
					path: '/service',
					component: service,
					name: 'Service'
				},
				{
					path: '/service_url',
					component: service_url,
					name: 'ServiceUrl'
				},
				{
					path: '/user',
					component: user,
					name: 'User'
				},
				{
					path: '/dashboard',
					component: dashboard,
					name: 'Dashboard'
				},
				{
					path: '/contract',
					component: contract,
					name: 'Contract'
				},
				{
					path: '/wiki',
					component: wiki,
					name: 'Wiki',
				},
				{
					path: '/wayneservice',
					component: wayneservice,
					name: 'Wayneservice'
				},
				// {
				// 	path: '/',
				// 	component: dashboard,
				// 	name: 'Dashboard'
				// },
			]
		}
	]
})
